<template>
  <el-config-provider :size="size" :locale="locale">
    <router-view></router-view>
  </el-config-provider>
</template>

<script setup lang="ts" name="App">
import { useAppStore } from "./store"
import zhCn from "element-plus/dist/locale/zh-cn.mjs"
import en from "element-plus/dist/locale/en.mjs"
import { useGenerateTheme } from "./hooks/useGenerateTheme"

// const appStore = useAppStore()
const { size, lang } = storeToRefs(useAppStore())

const locale = computed(() => {
  return lang.value === "zh-cn" ? zhCn : en
})

useGenerateTheme()
</script>
